<html lang="zh-CN">

<head>
    {% load bootstrap4 %}
    {% bootstrap_css %}
    {% bootstrap_javascript %}
    <title>产品自动化测试平台</title>
    <link href="../static/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/static/admin/css/forms.css" />
    <script type="text/javascript" src="/admin/jsi18n/"></script>
    <script type="text/javascript" src="/static/admin/js/vendor/jquery/jquery.js"></script>

    <script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
    <script type="text/javascript" src="/static/admin/js/core.js"></script>
    <script type="text/javascript" src="/static/admin/js/admin/RelatedObjectLookups.js"></script>
    <script type="text/javascript" src="/static/admin/js/actions.js"></script>
    <script type="text/javascript" src="/static/admin/js/urlify.js"></script>
    <script type="text/javascript" src="/static/admin/js/prepopulate.js"></script>
    <script type="text/javascript" src="/static/admin/js/vendor/xregexp/xregexp.js"></script>
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum- scale=1.0">
    <link rel="stylesheet" type="text/css" href="/static/admin/css/responsive.css" />
    <meta name="robots" content="NONE,NOARCHIVE" />
    <style> body{text-align:center} </style>

</head>

<body role="document">
      <!-- 导航栏-->
        <nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top">
            <div class="container">
                <a class="navbar-brand" href="#">&nbsp;</a>
                <ul class="nav justify-content-center">
                    <li class="active"><a style='color:white' href="/apis_manage/">单一接口</a></li>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <li><a style='color:white' href="/apitest_manage/">流程接口</a></li>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <li class="active"><a style='color:white' href="/appcase_manage/">app 用例</a></li>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <li class="active"><a style='color:white' href="/webcase_manage/">web 用例</a></li>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                </ul>
                <ul class="nav justify-content-end">
                    <li class="nav-link"><a style='color:white' href="#">{{user}}</a></li>
                    <li class="nav-link"><a style='color:white' href="/logout/">退出</a></li>
                </ul>
            </div>
        </nav>
    <!-- 流程接口测试步骤-->
    <div class="row">
        <!-- 搜索栏-->
        <div class="page-header" >
            <form class="navbar-form" method="get" action="/apistepsearch/">
                {% csrf_token %}
                <input type="search" name="apiname" placeholder="名称" required>
                <button type="submit">搜索</button>
            </form>
        </div>

        <div class="col-md-11">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>接口名称</th>
                        <th>接口名称</th>
                        <th>参数=值</th>
                        <th>方法</th>
                        <th>预期结果</th>
                        <th>测试结果
                        </th>
                        <th>时间</th>
                        <th>业务流名称</th>
                    </tr>
                </thead>
                <tbody>
                    {% for apistep in apisteps %}
                    <tr>
                        {% if apistep.Apitest.id == apitest.id %}
                        <td>{{ apistep.Apitest.Product.productname }}</td>
                        <td>case_{{ apistep.Apitest.id }}_{{ apistep.Apitest.apitestname }}</td>
                        <td>{{ apistep.apistep }}:{{ apistep.apiname }}</td>
                        <td>{{ apistep.apiurl }}</td>
                        <td>{{ apistep.apiparamvalue }}</td>
                        <td>{{ apistep.apimethod }}</td>
                        <td>{{ apistep.apiresult }}</td>
                        <td>{% if apistep.apistatus == 1 %}
                            <a style='color:green'>{{ apistep.apistatus }}</a>
                            {% else %}
                            <a style='color:red'>{{ apistep.apistatus }}</a>
                            {% endif %}
                        </td>
                        <td>{{ apistep.create_time }}</td>
                        {% else %}
                        {% endif %}
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>

        <td>
        <a style='color:light blue' href="../apitest_manage/">
            <img src="/static/admin/img/icon-yes.svg" alt="返回" />返回
        </a>
        </td>
        <td>
            <a style='color:light blue' class="related-widget-wrapper-link add-related" id="add_id_Apitest" href="../admin/apitest/apitest/{{ apitest.id	}}/change/?_to_field=id&_popup=1">
                <img src="/static/admin/img/icon-changelink.svg" />编辑</a>
        </td>

<span style="position:absolute; right:100px; bottom:30px;"> {# 把翻页功能固定显示在右下角#}
    <div class="container">
        <ul class="pagination" id="pager">
            {# 上一页链接开始#}
            {% if apisteps.has_previous %}
            {# 如果有上一页则正常显示上一页的链接#}
            <li class="previous"><a href="/apistep_manage/?page={{ apisteps.previous_page_number }}">上一页</a></li> {# 上一页标签 #}
            {% else %}
            <li class="previous disabled"><a href="#">上一页</a></li> {# 如果当前不存在上一页则上一页的链接不     可单击#}
            {% endif %}
            {# 上一页链接开始#}
            {% for num in apisteps.paginator.page_range %}
            {% if num == currentPage %}
            <li class="item active"><a href="/apistep_manage/?page={{ num }}">{{ num }}</a></li>
            {#显示当前页数链接#}
            {% else %}
            <li class="item"><a href="/apistep_manage/?page={{ num }}">{{ num }}</a></li>
            {% endif %}
            {% endfor %}
            {# 下一页链接开始#}
            {% if apisteps.has_next %} {# 如果有下一页，则正常显示下一页的链接#}
            <li class="next"><a href="/apistep_manage/?page={{ apisteps.next_page_number }}">下一页
                </a></li>
            {% else %}
            <li class="next disabled"><a href="#">下一页</a></li>
            {% endif %}
            {# 下一页链接结束#}
        </ul>
    </div>
</span>



</body>

</html>